const multer = require('multer') //配置 
const storage = multer.diskStorage({
    //文件保存路径 注意路径必须存在
    destination: function (req, file, cb)
    {
        cb(null, 'public/avatar/')
    },
    //修改文件名称 
    filename: function (req, file, cb)
    {
        // const fileFormat = (file.originalname).split(".");
        cb(null, file.originalname);
    }
})
const upload = multer({
    storage: storage
})
module.exports = { upload }